package com.example.demo.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 商品-属性关联表
 * </p>
 *
 * @author hpp
 * @since 2021-09-14
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("sp_goods_attr")
public class GoodsAttr extends Model<GoodsAttr> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 商品id
     */
    private Integer goodsId;

    /**
     * 属性id
     */
    private Integer attrId;

    /**
     * 商品对应属性的值
     */
    private String attrValue;

    /**
     * 该属性需要额外增加的价钱
     */
    private BigDecimal addPrice;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
